import openpyxl


import xlrd
from xlutils.copy import copy
def oop1():
    # wb=openpyxl.Workbook()
    work = xlrd.open_workbook("ceshishujvku.xlsx")
    print(work)
    old_cibtent=copy(work)
    ws=old_cibtent.get_sheet(0)
    ws.write(2,1,'jimclear')
    old_cibtent.save("jim.xlsx")




# if __name__ == '__main__':
#     oop1()

def oop2():
    wb=openpyxl.load_workbook("ceshishujvku.xlsx")
    sheet=wb.worksheets[0]
    for i in range(1,100):
        sheet.cell(i,3).value=""
        wb.save("jimlucky.xlsx")

# if __name__ == '__main__':
#     oop2()


def oop3():
    wb = openpyxl.Workbook()
    ws = wb.create_sheet("sheet1")
    for i in range(1, 100):
        ws.cell(row=i, column=1).value = "jim{}".format(i)
        wb.save("jim01.xlsx")


# if __name__ == '__main__':
#     oop3()

import xlrd
def oop4():


    books = xlrd.open_workbook("ceshishujvku.xlsx")

    sheet = books.sheet_by_index(0)

    # 选取行号(rowx)、列号(colx)都是0的A1是坐标原点（0，0）
    print(f"单元格A1的内容是：{sheet.cell_value(rowx=1, colx=0)}")
    print(f"第一行的内容是:{sheet.row_values(rowx=0)}")
    print(f"第一列的内容是:{sheet.col_values(colx=0)}")
    count = sheet.col_values(colx=2, start_rowx=1)
    print(f"汇总:{sum(count)}")
# if __name__ == '__main__':
#     oop4()


import re
